<?php !defined("IN_SYSTEM") && exit("ACCESS DENY");?>
{template header}
{template top}
<div id="uc">
{template uc/left}
<div id="uc_main">
	<div class="uc_tab">
	<ul>
		<li>{if !$action}<span class="on">基本资料</span>{else}<a href="{url('home.php?f=profile')}">基本资料</a>{/if}</li>
		<li>{if $action == 'password'}<span class="on">修改密码</span>{else}<a href="{url('home.php?f=profile&a=password')}">修改密码</a>{/if}</li>
	</ul>
	</div>
	
	<div id="uc_contain">
	{if !$action}
		<form name="user_add" method="post" action="{url('home.php?f=profile&a=save')}"  enctype="multipart/form-data">
	<input type="hidden" name="uid" value="{$result['uid']}" />
	<table cellspacing="0" class="uc_fa_table">
		<tr>
			<td colspan="2" ><img src="{if $result['picture']}{$result['picture']}{else}static/images/avatar.jpg{/if}" style="width:60px;height:70px;float:left;margin-right:5px;"></img>
			<a href="javascript:;" >上传新头像:</a><br/>
			<input type="file" name="avatar" id="avatar" size="18"/><br/>
			<span class="uc_tips">{$lang['avatar_size_desc']}</span>
			</td>
			<td colspan="2">
			<table>
			<tr>
			<td class="td1" style="text-align:right;">用户名：</td>
			<td>{$result['username']}</td></tr><tr>
			<td class="td1" style="text-align:right;">性别：</td>
			<td><input type="radio" name="sex" {if $result['sex'] == 0}checked{/if} value="0" />女  <input type="radio" name="sex" value="1" {if $result['sex'] == 1}checked{/if}/>男 </td>
			</tr>
			</table>
			</td>
			
		</tr>
		<tr>
			<td class="td1" >生日：</td>
			<td colspan="3" >
			{php $years=range(1950,2011)}
			<select name="bornyear" id="bornyear" onchange="makeday('bornday','bornyear','bornmonth')"><option value="0" label="年">年</option>{loop $years $year}<option value="{$year}" {if substr($result['birthday'],0,4) == $year}SELECTED{/if}>{$year}</option>{/loop}</select>
			<select name="bornmonth" id="bornmonth" onchange="makeday('bornday','bornyear','bornmonth')"><option value="0" label="月">月</option>{php $months = range(1,12);}
			{loop $months $month}<option value="{$month}" {if substr($result['birthday'],5,2) == $mont}SELECTED{/if}>{$month}</option>{/loop}</select>
			<select name="bornday" id="bornday"><option value="0">日</option>{php $days = range(1,31)}
			{loop $days $day}<option value="{$day}" {if substr($result['birthday'],8,2) == $day}SELECTED{/if}>{$day}</option>{/if}</select>
			</td>
		</tr>
		<tr>
			<td class="td1">手机：</td>
			<td ><input type="text" name="phone" class="input" value="{$result['phone']}" size="22" /></td>
			<td class="td2">电话：</td>
			<td><input type="text" name="tel" class="input" size="22" value="{$result['tel']}" /></td>
		
		</tr>
		<tr>
			<td  class="td1">QQ：</td>
			<td  colspan="3"><input type="text" name="qq" class="input" size="57" value="{$result['qq']}" /></td>
		</tr>
		
		<tr>
			<td class="td1">电话：</td>
			<td colspan="3"><input type="text" name="tel" class="input" size="57" value="{$result['tel']}" /></td>
		</tr>
		
		<tr>
			<td class="td1">MSN：</td>
			<td colspan="3"><input type="text" name="msn" class="input" size="57" value="{$result['msn']}" /></td>
		</tr>
		<tr>
			<td class="td1">自称评价：</td>
			<td colspan="3"><input type="text" name="signature" class="input" size="57" value="{$result['signature']}" /></td>
		</tr>
		<tr class="bg2"><td class="td1"></td><td colspan="3"><input type="submit" class="button" value="保存" /> </td></tr>
	</table>
	</form>
	{/if}
	{if $action == 'password'}
		<form method="post" action="{url('home.php?f=profile&a=password')}">
	<input type="hidden" name="uid" value="{$result['uid']}" />
	<table cellspacing="0" class="sub">
		<tr>
			<td colspan="2"><div id="tip"></div></td>
		</tr>
		{if !$reset}
		<tr>
			<td align="right">原密码：</td>
			<td><input type="text" name="oldpassword" class="input" size="40" value="" /></td>
		</tr>
		{/if}
		<tr>
			<td align="right">新密码：</td>
			<td><input type="text" name="password" class="input" size="40" value="" /></td>
		</tr>
		<tr>
			<td align="right">确认新密码：</td>
			<td><input type="text" name="repassword" class="input" size="40" value="" /></td>
		</tr>
		<tr class="bg2"><td></td><td><input type="submit" class="button" value="保存" /> </td></tr>
		</table>
		</form>
	{/if}
</div>
</div>
</div>
{template footer}